<?php

namespace App\Http\Controllers\Api\v1;

use App\common;
use App\Logic\Alipay;
use App\Logic\FactoryPay;
use App\Logic\PaybrcheFacaory;
use Illuminate\Http\Request;

class Renting
{
    /**
     * @name wl
     * @function  支付方式
     */
    public function rentPay(Request $request)
    {
        try {
            $type = $request->get('type');
            $reservation = PaybrcheFacaory::getReservationInstance($type);
            $handler = new FactoryPay($reservation);
            $data = $handler->makeReservation();
            return common::success(20000, 'ok', $data);
        } catch (\Exception $exception) {
            return common::fail('', "", $exception->getMessage());
        }
    }
}
